import { http } from '@/utils/request'
import type { ListParams, ListType } from './type.ts'

const prefix = '/bizapi'
// 列表
export function getInterfaceList(params: { name: string } & Page) {
	return http.get<ResPage<ListType[]>>(`${prefix}/interfaceInfo/list`, params)
}

export function getData() {
	return http.get<ResPage<{ businessSystemName: string; id: string }[]>>(`${prefix}/interfaceInfo/list`)
}

// 删除表数据
export function delInterfaceInfo(interfaceId: string) {
	return http.delete(`${prefix}/interfaceInfo/${interfaceId}`)
}

export function addType(data: ListParams) {
	return http.post(`${prefix}/interfaceInfo`, data)
}

// 修改字典类型
export function updateType(data: ListParams) {
	return http.put(`${prefix}/interfaceInfo`, data)
}
